package com.qlk.vorder.dao.impl;

import com.qlk.common.dao.mybatis.BaseDao;
import com.qlk.vorder.dao.SerialLogDao;
import com.qlk.vorder.domain.SerialLog;
import com.qlk.vorder.domain.query.SerialLogQuery;

import java.util.List;
import org.springframework.stereotype.Repository;

/**
 * SerialLogDAO实现类<br/>
 * 对'日志流水'表进行基本的操作
 * 
 * @author zhaoyanan
 * @version 2016-7-28 14:13:59
 * 
 */
@Repository
public class SerialLogDaoImpl extends BaseDao implements SerialLogDao {
	/** namespace */
	private final String namespace = SerialLogDaoImpl.class.getName();

	/**
	 * {@inheritDoc}
	 */
	public List<SerialLog> querySerialLogList(SerialLogQuery queryBean) {
		return (List<SerialLog>) queryForList(namespace + ".querySerialLogList", queryBean);
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean insert(SerialLog serialLog) {
		return insert(namespace + ".insert", serialLog);
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean update(SerialLog serialLog) {
		return update(namespace + ".update", serialLog);
	}

	/**
	 * {@inheritDoc}
	 */
	public int querySerialLogCount(SerialLogQuery queryBean) {
		return (Integer) queryForObject(namespace + ".querySerialLogCount", queryBean);
	}

	/**
	 * {@inheritDoc}
	 */
	public List<SerialLog> querySerialLogListWithPage(SerialLogQuery queryBean) {
		return (List<SerialLog>) queryForList(namespace + ".querySerialLogListWithPage", queryBean);
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean delete(SerialLog configuration) {
		return delete(namespace + ".delete", configuration);
	}

	/**
	 * {@inheritDoc}
	 */
	public SerialLog getSerialLogById(Long id) {
		return (SerialLog) queryForObject(namespace + ".getSerialLogById", id);
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean exist(SerialLog serialLog) {
		int count = (Integer) queryForObject(namespace + ".exist", serialLog);
		return count > 0;
	}
}
